package com.bit.inmap;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.KeyEvent;
import android.view.Menu;
import android.widget.TextView;

public class QandSubActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_qand_sub);
		
		Intent intent = getIntent();
		
		String value = intent.getExtras().getString("value");
		String title = intent.getExtras().getString("title");
		
		TextView textview = (TextView) this.findViewById(R.id.sub_page_title);
		textview.setText(title);
		
		TextView textview2 = (TextView) this.findViewById(R.id.sub_page_content);
		textview2.setText(value);
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.qand_sub, menu);
		return true;
	}
	
	public boolean onKeyDown(int KeyCode, KeyEvent event) {
		if (KeyCode == KeyEvent.KEYCODE_BACK) {
			Intent btn = new Intent(QandSubActivity.this, QandActivity.class);
			startActivity(btn);
			this.finish();
		}
		return true;
	}
	
}